<!DOCTYPE html>
<html>
<script src="/static/HPLUS/js/jquery-1.7.2.min.js"></script>
    <link href="/static/HPLUS/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/static/HPLUS/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/static/HPLUS/css/animate.min.css" rel="stylesheet">
    <link href="/static/HPLUS/css/style.min.css?v=4.0.0" rel="stylesheet">
 <link href="/static/HPLUS/css/plugins/chosen/chosen.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>

<body id="body-right">
    <!-- 标题栏 -->
    <div class="main-title">
        <h1>数据备份</h1>
        <hr>
    </div>
    <!-- /标题栏 -->

 

    <!-- 应用列表 -->
    <div class="col-sm-12">
    <div class="ibox-title">
         <div class="alert alert-success">
         <p>一共{$total};共{$tables}个表</p>
         <p>
             <a href="/admin/backup/export" target="_blank" class="backup-choose btn btn-w-m btn-success">备份</a>
             <a href="/admin/backup/chekbackdir" target="_blank" class="backup-choose btn btn-w-m btn-info">查看备份文件</a>
         </p>
         </div>
    </div>
        <form id="export-form" method="post" action="">
            <table class="table2 table table-bordered">
                <thead>
                    <tr>
                        <!-- <th width=""><input class="check-all" checked="chedked" type="checkbox" value=""></th> -->
                        <th>表名</th>
                        <th width="">数据量</th>
                        <th width="">数据大小</th>
                        <th width="">创建时间</th>
                        <th width="">操作</th>
                    </tr>
                </thead>
                <tbody>
                  <?php foreach ($list as $key => $v): ?>
                        <tr>
                          <!--   <td class="num">
                                <input class="ids" checked="chedked" type="checkbox" name="tables[]" value="{$v.Name}">
                            </td> -->
                            <td>{$v.Name}</td>
                            <td>{$v.Rows}</td>
                            <td>{$v.Data_length|format_bytes}</td>
                            <td>{$v.Create_time}</td>
                            <td class="action">
                                <a class="btn btn-outline btn-primary btn-xs" href="/admin/backup/optimize/table/{$v.Name}">优化表</a>&nbsp;
                                <a class="btn btn-outline btn-success btn-xs" href="/admin/backup/repair/table/{$v.Name}">修复表</a>
                                <a class="btn btn-outline btn-info btn-xs" href="/admin/backup/export/table/{$v.Name}" target="_blank">备份当前表</a>
                            </td>
                        </tr>
                 <?php endforeach ?>
                </tbody>
            </table>
        </form>
    </div>
    <!-- /应用列表 -->

<script>
            $(function(){
               
                //全选的实现
                $(".check-all").click(function(){
                    $(".ids").prop("checked", this.checked);
                });
                $(".ids").click(function(){
                    var option = $(".ids");
                    option.each(function(i){
                        if(!this.checked){
                            $(".check-all").prop("checked", false);
                            return false;
                        }else{
                            $(".check-all").prop("checked", true);
                        }
                    });
                });
            
            });
         </script>
</body>
</html>